package com.ssyt.yt1.day14.innerclass.c;

/**
 * <pre>
 * 方法内部类（了解）
 * 1）方法内部类里不能定义static的静态属性或成员方法
 * 2）方法内部类只能在方法里有效！
 * </pre>
 * 
 * @author Administrator
 *
 */
public class InnerClassDemo {

	public static void main(String[] args) {
		testMethodInnerClass();
	}

	public static void testMethodInnerClass() {
		final int a = 123;
		// Valid in JDK 8 and later:
		// int a = 123;

		class Student {
			String name;
			int age;

			public void get() {
				// a = 1224;
				System.out.println(a);
			}
		}

		Student student = new Student();
		student.name = "zhangsan";
		student.age = 20;

		System.out.println(student);
	}
}
